Skip to main content

All Questions

-1votes
1answer
71views

creating hard links Linux question [duplicate]

From the book The Linux Command Line by William Shotts, page 33: So now we have four instances of the file fun. Let's take a look at our playground directory. [me@linuxbox playground]$ ls -1 total 16 ...
Guilherme Woolley's user avatar
0votes
3answers
1kviews

ls -d command only returns `.` eg, and no child directories

I have standard ls installed, I also have lsd installed, which is a nerd-font drop-in replacement for ls. I mention this because the error may have something to do with the alias. For testing right ...
Andy T's user avatar
5votes
3answers
4kviews

ls -ad */ won't display hidden directories [duplicate]

pwd is my home directory. ls */ -d displays the directories. ~$ ls */ -d Blog/ Desktop/ Documents/ Downloads/ Music/ Pictures/ Public/ Templates/ Videos/ And ls -a displays all hidden ...
NayabSD's user avatar
1vote
2answers
215views

Explaining what this command does

ls *.txt | lp Wouldn't this command list all files that end in .txt and then print them?
OneEyedOwl's user avatar
28votes
2answers
3kviews

Inconsistent color output from `ls` command

I teach an Intro to UNIX/Linux course at a local college and one of my students asked the following question: Why are some of the files in my directory colored white and others are gray? Are the ...
Bill R's user avatar
1vote
3answers
3kviews

Using ls to find files that end in a character, ignoring extension

I am supposed to use ls to find files that end in a certain letter, but it does not matter if the file has an extension or not. For example, I want it to do this > ls test test.txt test.ascii ...
Anthony Rulli's user avatar
0votes
1answer
544views

how to pipe ls -ltr after list of files to capture date and time

we have script that print all bad wsp files ./print_bad_wsp_files.sh ./aaaa/rrr/aaaa/fff/ooo/min.wsp ./aaaa/rrr/aaaa/fff/ooo/p50.wsp ./aaaa/rrr/aaaa/fff/ooo/min.wsp ./aaaa/rrr/aaaa/fff/ooo/p50.wsp #...
yael's user avatar
  • 13.9k
0votes
1answer
593views

Why doesn't the “ls -1” command work correctly? [closed]

I'm trying to learn linux commands, but the output wasn’t what I expected.
whiskygsc's user avatar
2votes
1answer
4kviews

Is it possible to change the default behavior of a command?

Is it possible to change the default behavior of a command? I assume that this question is pretty straight forward but let me give an illustration and example. While connected to some servers via ...
Daniel Morris's user avatar
3votes
5answers
7kviews

The result of "ls | wc -l" does not match the real number of files [duplicate]

I need to count the number of files under a folder and use the following command. cd testfolder bash-4.1$ ls | wc -l 6 In fact, there are only five files under this folder, bash-4.1$ ls total 44 -rw-...
user288609's user avatar
16votes
7answers
23kviews

What to use when the "ls" command doesn't work?

I tried to use the ls command and got an error: bash: /bin/ls: cannot execute binary file What can I use instead of this command?
user avatar
23votes
2answers
48kviews

syntax of ls --hide= and ls --ignore=

ls --hide and ls --ignore provides the possibility leave out files defined through regular expressions set after the --ignore= part. The latter makes sure that this option isn't turned off via -a, -A. ...
erch's user avatar
  • 5,170
161votes
10answers
443kviews

How to output only file names (with spaces) in ls -Al?

I should echo only names of files or directories with this construction: ls -Al | while read string do ... done ls -Al output : drwxr-xr-x 12 s162103 studs 12 march 28 12:49 personal ...
Alex Zern's user avatar
11votes
2answers
2kviews

Highlight the three last updated files in ls output

Is there any way to overload or wrap the ls command so that it will highlight / underline / otherwise make obvious the last three modified files? I know that I can simply ls -rtl to order by reverse ...
dotancohen's user avatar
18votes
3answers
6kviews

Output ls -l size field with digits grouped by thousands?

It is possible to make ls -l output the size field with digits grouped by thousands? If so, how? For instance: $ ls -l -rw-rw---- 1 dahl dahl 43,210,052 2012-01-01 21:52 test.py (Note the commas in ...
Roger Dahl's user avatar

153050per page
close